package com.hgyc.mom.common.util.sql;

/**
 * @author fwj
 * @since 2025/5/3
 */
public class OracleDialect implements SqlDialect {
    @Override
    public String buildPagedSql(String sql, long offset, long size) {
        long end = offset + size;
        return "SELECT * FROM (\n" +
                "  SELECT t.*, ROWNUM rn FROM (\n" + sql + "\n) t WHERE ROWNUM <= " + end + "\n" +
                ") WHERE rn > " + offset;
    }
}
